#include<stdio.h>
#include<unistd.h>
#include<string.h>
#define NUM 100
int main()
{
  char bar[NUM+2];
  memset(bar, 0, sizeof(bar));
  const char *label = "|/-\\";
  int i = 0;
  while(i<=NUM)
  {
    bar[i]='#';
    printf("[%-101s][%d%%][%c]\r", bar, i, label[i%4]);
    fflush(stdout);
    usleep(100000);
    i++;
  }
  printf("\n");
  return 0;
}
